<template>
	<view>
		<!-- <view class="display flex-wrap align-start justify-between" >
			<view class="margin-l20" style="width: 45%;height: 250upx;color: #F0F8FF;">
				车间1
				<video style="width: 100%;height: 100%; " src="http://hls01open.ys7.com/openlive/51aa05e7dfdd43198df9d4a1365a79f8.hd.m3u8"
				 show-progress controls="true" objectFit="cover" page-gesture="true"></video>
			</view>
			<view class="margin-l20" style="width: 45%;height: 250upx;color: #F0F8FF;">
				车间2
				<video style="width: 100%;height: 100%;  " src="http://hls01open.ys7.com/openlive/51aa05e7dfdd43198df9d4a1365a79f8.hd.m3u8"
				 controls="true" objectFit="cover" page-gesture="true"></video>
			</view>
			<view class="margin-l20 margin-t30" style="width: 45%;height: 250upx;color: #F0F8FF;">
				车间3
				<video style="width: 100%;height: 100%;  " src="http://hls01open.ys7.com/openlive/51aa05e7dfdd43198df9d4a1365a79f8.hd.m3u8" controls="true" objectFit="cover"
				 page-gesture="true"></video>
			</view>
			<view class="margin-l20 margin-t30" style="width: 45%;height: 250upx;color: #F0F8FF;">
				车间4
				<video style="width: 100%;height: 100%;  " src="http://hls01open.ys7.com/openlive/51aa05e7dfdd43198df9d4a1365a79f8.hd.m3u8" controls="true" objectFit="cover"
				 page-gesture="true"></video>
			</view>
			<view class="margin-l20 margin-t30 " style="width: 45%;height: 250upx; color: #F0F8FF;">
				车间6
				<video style="width: 100%;height: 100%;  " src="http://hls01open.ys7.com/openlive/51aa05e7dfdd43198df9d4a1365a79f8.hd.m3u8" controls="true" objectFit="cover"
				 page-gesture="true"></video>
			</view>
			<view class="margin-l20 margin-t30 " style="width: 45%;height: 250upx; color: #F0F8FF;">
				车间6
				<video style="width: 100%;height: 100%;  " src="http://hls01open.ys7.com/openlive/51aa05e7dfdd43198df9d4a1365a79f8.hd.m3u8" controls="true" objectFit="cover"
				 page-gesture="true"></video>
			</view>
			<view class="margin-l20 margin-t30 " style="width: 45%;height: 250upx; color: #F0F8FF;">
				车间6
				<video style="width: 100%;height: 100%;  " src="http://hls01open.ys7.com/openlive/51aa05e7dfdd43198df9d4a1365a79f8.hd.m3u8" controls="true" objectFit="cover"
				 page-gesture="true"></video>
			</view>
			<view class="margin-l20 margin-t30 " style="width: 45%;height: 250upx; color: #F0F8FF;">
				车间6
				<video style="width: 100%;height: 100%;  " src="http://hls01open.ys7.com/openlive/51aa05e7dfdd43198df9d4a1365a79f8.hd.m3u8" controls="true" objectFit="cover"
				 page-gesture="true"></video>
			</view>
			<view class="margin-l20 margin-t30 " style="width: 45%;height: 250upx; color: #F0F8FF;">
				车间6
				<video style="width: 100%;height: 100%;  " src="http://hls01open.ys7.com/openlive/51aa05e7dfdd43198df9d4a1365a79f8.hd.m3u8" controls="true" objectFit="cover"
				 page-gesture="true"></video>
			</view>
			<view class="margin-l20 margin-t30 " style="width: 45%;height: 250upx; color: #F0F8FF;">
				车间6
				<video style="width: 100%;height: 100%;  " src="http://hls01open.ys7.com/openlive/51aa05e7dfdd43198df9d4a1365a79f8.hd.m3u8" controls="true" objectFit="cover"
				 page-gesture="true"></video>
			</view>
			<view class="margin-l20 margin-t30 " style="width: 45%;height: 250upx; color: #F0F8FF;">
				车间6
				<video style="width: 100%;height: 100%;  " src="http://hls01open.ys7.com/openlive/51aa05e7dfdd43198df9d4a1365a79f8.hd.m3u8" controls="true" objectFit="cover"
				 page-gesture="true"></video>
			</view>
		</view> -->


		<video src="http://aqmore.sxpz.vip/suCai.mp4" controls show-center-play-btn="false" @play="play" @pause="pause"
		 @ended="ended" @waiting="waiting" enable-progress-gesture="false" @timeupdate="forbidDragProgress"></video>

	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		onReady: function(res) {
			this.videoContext = uni.createVideoContext('myVideo')
		},
		methods: {
			play() { //开始
				console.log("开始")
			},
			pause() { //暂停
				console.log("暂停")
			},
			ended() { //结束
				console.log("结束")
			},
			waiting() { //缓冲
				console.log("缓冲")
			},

			forbidDragProgress(res) {
				console.log(res)
				let time =parseFloat(res.detail.currentTime);
				if ((time - this.videoCurrentTime).toFixed(3) > 2) {
					let nowtime = this.videoCurrentTime.toFixed(0);
					this.videoContext.seek(nowtime);
				} else {
					this.videoCurrentTime = time;
				}
			}
		}
	}
</script>

<style>
	page {
		width: 100%;
		height: 100%;
		/* background-color: #03182b; */
	}
</style>
